﻿using System.Collections.Generic;

namespace OpenLS.Spreadsheet
{
    internal abstract class CellRegion
    {
        public  IEnumerable<Cell> GetCells(RangeAddress rangeAddress)
        {
            return CellHelper.DistinctCells(Enumerable.Where(GetAllCells(), c => rangeAddress.Intersects(c.GetRangeAddress())));
        }

        protected abstract IEnumerable<Cell> GetAllCells();
        public abstract ClusterImpact GetClusterImpact(CellClusterKey key);
    }
}